cmake_minimum_required(VERSION 3.16)

project(TensorRT)

set(CMAKE_BUILD_TYPE Debug)
#set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -o0 -Wall -g -ggdb")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories(/home/xzy/Data2/xzyLinuxInstallPackage/5TensorRT/TensorRT-7.2.1.6/include/)
file(GLOB_RECURSE trtlib /home/xzy/Data2/xzyLinuxInstallPackage/5TensorRT/TensorRT-7.2.1.6/lib/*.so)
#include_directories(/home/xzy/Data2/xzyLinuxInstallPackage/5TensorRT/TensorRT-7.1.3.4/include/)
#file(GLOB_RECURSE trtlib /home/xzy/Data2/xzyLinuxInstallPackage/5TensorRT/TensorRT-7.1.3.4/lib/*.so)
#include_directories(/home/xzy/Data2/xzyLinuxInstallPackage/5TensorRT/TensorRT-7.2.3.4/include/)
#file(GLOB_RECURSE trtlib /home/xzy/Data2/xzyLinuxInstallPackage/5TensorRT/TensorRT-7.2.3.4/lib/*.so)
message("tensort lib: in " ${trtlib})
LINK_LIBRARIES(${trtlib})

find_package(CUDA REQUIRED)
include_directories(${CUDA_INCLUDE_DIRS})
link_libraries(${CUDA_LIBRARIES})
message("cuda h: " ${CUDA_INCLUDE_DIRS})
message("cuda lib: " ${CUDA_LIBRARIES})

set(OpenCV_DIR "/usr/local/opencv4.4.0/lib/cmake/opencv4")
find_package(OpenCV  REQUIRED)
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
LINK_LIBRARIES(${OpenCV_LIBS})

#file(GLOB_RECURSE head_file ./*.h)
#include_directories(${head_file})

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR})  # 设定h文件路径
add_subdirectory(function function)
LINK_LIBRARIES(functionlib)

#add_subdirectory(plugin plugin)

SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
add_executable(infer_test "infer_test.cpp")
add_executable(testNet "testNet.cpp")
add_executable(mnist "mnist.cpp")
add_executable(resnet50 "resnet50.cpp")
add_executable(SourceMnist "SourceMnist.cpp")
add_executable(onnx2trt "onnx2trt.cpp")
add_executable(onnx2trt_gcn "onnx2trt_gcn.cpp")
add_executable(sample "sample.cpp")

#########################################
# test
add_executable(cublasTest "cublasTest.cpp")
target_link_libraries(cublasTest cublas)
